package com.example.music;

import android.util.Log;

import java.io.File;
import java.io.FileFilter;
import java.util.List;

public class LocalVideo {

              public static void getVideoFile(final List<MediaBean> list, File file){
                                   file.listFiles(new FileFilter() {
                                       @Override
                                       public boolean accept(File file) {
                                           String name=file.getName();
                                           if (name.endsWith(".ogg")||name.endsWith(".mp3")||name.endsWith(".wav")
                                                   ||name.endsWith(".wma")||name.endsWith(".flac")){

                                               MediaBean video=new MediaBean();
                                               video.filename=file.getName();
                                               video.path=file.getPath();
                                               Log.d("path", file.getPath());
                                               list.add(video);


                                           }else if (file.isDirectory()){
                                               getVideoFile(list,file);

                                           }

                                           return false;
                                       }
                                   });

              }
}
